* ======================================
* ---------- Import marriage -----------
* ======================================


	use $dta_raw/dta9/W19_0078_SIVILSTAND.dta, replace
	
	rename w19 idPers
	bysort idPers: gen n = _N
	drop if n > 1 // 84 inconsistencies
	
* 2015
* ====

	preserve
	gen year = 2015
	gen married = 1*(sivilstand_2015 == "2")
	keep married year idPers
	tempfile mar2015
	save `mar2015'
	restore

* 2019
* ====

	preserve
	gen year = 2019
	gen married = 1*(sivilstand_2019 == "2")
	keep married year idPers
	tempfile mar2019
	save `mar2019'
	restore
	
* Append
* ======

	clear
	append using `mar2015'
	append using `mar2019'	
	
	
	save "$dta\ImportMarriage.dta",replace